package com.example.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
@ConfigurationProperties(prefix = "student")
//@RefreshScope
public class DemoConfig {

//    @Value("${student.name}")
    private String name;

//    @Value("${student.age}")
    private int age;

//    @Value("${student.score}")
    private int score;

    private List<Integer> scoreList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public List<Integer> getScoreList() {
        return scoreList;
    }

    public void setScoreList(List<Integer> scoreList) {
        this.scoreList = scoreList;
    }

    @Override
    public String toString() {
        return "DemoConfig{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", scoreList=" + scoreList +
                '}';
    }
}
